from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from django.forms import ModelForm
from whoisspy.models import Player

class RegistrationForm(UserCreationForm):
    username = forms.charField(max_length=30, min_length=3, label='用户名')
    email = forms.EmailField(lable="电子邮箱")
    password1 = forms.CharField(widget=forms.PasswordInput, min_length=5, label="密码")
    password2 = forms.CharField(widget=forms.PasswordInput, min_length=5, label="确认密码")

    class Meta:
        model = Player
        fields = ("username", "email", "password1", "password2")